<!-- 百度统计用的frame -->
<div id="Track" class="hide">
    <iframe id="TrackFrame" src=""></iframe>
</div>

<!-- baidu统计 -->
<script async>
    // 影响加载速度了,延后加载百度统计，即使此统计代码是所谓异步加载
    setTimeout(function () {
        var _hmt = _hmt || [];
        (function () {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?e50695bb38e14c2973d5633e2884e518";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
    },3000);
</script>
<!-- growing io -->
<!--<script  defer>-->
    <!--var _vds = _vds || [];-->
    <!--window._vds = _vds;-->
    <!--(function () {-->
        <!--_vds.push(['setAccountId', '892d2771d972fd9c']);-->
        <!--(function () {-->
            <!--var vds = document.createElement('script');-->
            <!--vds.type = 'text/javascript';-->
            <!--vds.async = true;-->
            <!--vds.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'dn-growing.qbox.me/vds.js';-->
            <!--var s = document.getElementsByTagName('script')[0];-->
            <!--s.parentNode.insertBefore(vds, s);-->
        <!--})();-->
    <!--})();-->
<!--</script>-->
<script>
    var hasBind = funs.qs("login_bind");
    // 如果不是开发环境
    var href = window.location.href;
    if (href.indexOf('wph.com') < 0 && hasBind != '1') {
        var login_bind = '?login_bind=1';
        if (href.indexOf('?') > 0) {
            login_bind = '&login_bind=1';
        }
        if (href.indexOf('welcome') > 0) {
            href = href.replace('welcome=1', 'welcome=0');
        }
        href += login_bind;
        href = encodeURIComponent(href);
        window.location.href = APIURL + '/Login/handleLogin4Wx?redirect_url=' + href;
    }

    //统计关注公众号自动回复消息的点击率
    var welcome = funs.qs('welcome');
    if (welcome == '1') {
        api.event_welcome();
    }
    // 实际的当前项目id
    var current_demand_id = funs.qs("did");
    var current_uid = funs.qs("uid");
    var partical = funs.qs("partaken");
    var freeList = funs.qs("freelist");

    if (current_demand_id) {
        globalData.currPage = "demand";
        globalData.current_demand.id = current_demand_id;
    }
    // 直接进入洽谈室
    if (current_uid) {
        globalData.currPage = "chatroom";
        globalData.current_demand.user.id = current_uid;
    }
    //微信进入采购，制作，租赁，维修报装时，区分判断
    var Type = funs.qs("type") || '1';
    globalData.currType = Type;

    //直接进入“我参与的”首页
    if (partical) {
        globalData.particalList = true;
    }
    //直接进入“免费订单”首页
    if (freeList) {
        globalData.freeList = true;
    }

    // 页面卸载的时候，保存项目列表
    window.onbeforeunload = function () {
        var prolist = globalData.project_list;
        prolist = JSON.stringify(prolist);
        localStorage.setItem("prolist", prolist);
    };
</script>